<?
	$params[sid] = $sid;
	$params[action] = "editRemoteFormsDomain";
	$url = "$baseURL/$webDIR/?".encode_params($params);

	include('wallet_db.html');

	if (!empty($_POST['form_sent']) && $_POST['form_sent'] == 'yes') {
		unset($_POST['Save_Settings'],$_POST['form_sent']);
		foreach ($_POST as $key => $value) {
			foreach ($value as $k => $val) {
				$val = addslashes($val);
				$query[] = "UPDATE interface_settings SET ".$k." = '".$val."' WHERE reseller_id='".$id."' AND interface_type='domain' AND element_type='".$key."'";
			}
		}
		//------------------------------------------------------
			$sql['type']='transaction';
			$sql['params']=$query;
			$sql['table']='';
			$sql['where']="";
			$sql['options']='';
			$sql['return']='';
		//------------------------------------------------------
		if (!$result = sql_exec($sql,$dbh81,'')) {
			$errorMsg = translate('int_error');
			include_once('errorMsg.html');
			exit();
		}
	}

	//------------------------------------------------------
		$sql['type']='SELECT';
		$sql['params']='*';
		$sql['table']='interface_settings';
		$sql['where']="reseller_id='$id' and interface_type = 'domain'";
		$sql['options']='';
		$sql['return']='struct';
	//------------------------------------------------------
	if (!$result = sql_exec($sql,$dbh81,'assoc')) {
		$result = fix_empty_remote_forms($id,'domain');
		if (empty($result)) {
			$errorMsg = translate('int_error');
			include_once('errorMsg.html');
			exit();
		}
	}

	foreach ($result as $value) {
		$interface[$value['element_type']]['color'] = $value['color'];
		$interface[$value['element_type']]['width'] = $value['width'];
		$interface[$value['element_type']]['align'] = $value['align'];
	}

?>

<table width="550">
  <tr>
    <td colspan=2>
      <p><font class="text"><b><?=translate('domain_search_form');?></b><br>
        <br>
	<?=translate('domain_search_desc');?>
</p>

        </td>
  </tr>
</table>
<br>
<?
	if ($errorMsg) {
	include_once('errorMsg.html');
	}
	if ($okMsg) {
	include_once('okMsg.html');
	}
	else{
	}
?>
<table cellspacing=0 class=bTable width='550'>
	<form action="<?=$url?>" method=POST>
	<tr>
			<th colspan=2><?=translate('dom_form_meas');?> :</th>
	</tr>
	<tr>
	<tr>
			<td><?=translate('brd_width');?>:</td><td>
				<input type=radio name='border[width]' value='1' <? if ($interface['border']['width'] == 1) echo "checked";?>>1<?=translate('px');?> &nbsp;&nbsp;
				<input type=radio name='border[width]' value='2' <? if ($interface['border']['width'] == 2) echo "checked";?>>2<?=translate('px');?> &nbsp;&nbsp;
				<input type=radio name='border[width]' value='3' <? if ($interface['border']['width'] == 3) echo "checked";?>>3<?=translate('px');?> &nbsp;&nbsp;
				<input type=radio name='border[width]' value='4' <? if ($interface['border']['width'] == 4) echo "checked";?>>4<?=translate('px');?> &nbsp;&nbsp;
			</td>
	</tr>

	<tr>
			<th colspan=2><?=translate('dom_form_colors');?> :</th>
	</tr>
	<tr>
			<td><?=translate('bg');?>:</td><td><input type=text name='background[color]'  value='<?=$interface['background']['color'];?>'maxlength=7 size=8></td>
	</tr>
	<tr>
			<td><?=translate('brd');?>:</td><td><input type=text name='border[color]'  value='<?=$interface['border']['color'];?>' maxlength=7 size=8></td>
	</tr>
	<tr>
			<td><?=translate('font');?>:</td><td><input type=text name='font[color]'  value='<?=$interface['font']['color'];?>' maxlength=7 size=8></td>
	</tr>
	<tr>
			<td><?=translate('result');?>:</td><td><input type=text name='result[color]'  value='<?=$interface['result']['color'];?>' maxlength=7 size=8></td>
	</tr>
	<tr>
			<td><?=translate('result_link');?>:</td><td><input type=text name='links[color]'  value='<?=$interface['links']['color'];?>' maxlength=7 size=8></td>
	</tr>
	<tr>
			<td><?=translate('form_text');?>:</td><td><input type=text name='text[color]'  value='<?=$interface['text']['color'];?>' maxlength=7 size=8></td>
	</tr>
	<tr>
			<td><?=translate('form_title');?>:</td><td><input type=text name='title[color]'  value='<?=$interface['title']['color'];?>' maxlength=7 size=8></td>
	</tr>
	<tr>
		<td align=center colspan=2><input type=submit name='<?=translate('save');?>' value='<?=translate('save');?>'>
			<input type="hidden" name="form_sent" value="yes">
		</td>
	</tr>
	</form>
</table>

<br>

<table width="550">
  <tr>
    <td colspan=2>
      <p><font class="text"><b><?=translate('dom_search_html');?></b><br>


        </font></td>
  </tr>
</table>
<br>

<TABLE border=1 class='bTable' cellspacing='0' width='550'>
<tr>

    <th> <?=translate('ready_2_use');?>: </th>
</tr>
<tr>
    <td> &lt;iframe frameborder='0' style='width:<font color="red">650</font>;height:<font color='red'>750</font>;'
      src='http://www.duoservers.com/?r=<font color='red'><?=$userName;?></font>&action=f_domain'&gt; &lt;/iframe&gt;<br>



    </td>
</tr>

</table>
<script>
function showExpl(){

	if(document.getElementById('explane').style.display=='block') document.getElementById('explane').style.display='none';
	else document.getElementById('explane').style.display='block';

}
</script>
<TABLE border=1 class='bTable' cellspacing='0' width='550'>
<tr>
    <th><a href='#' onClick="showExpl()"><?=translate('explanation');?>: </a></th>
</tr>
</table>
<div id='explane' style="display:'none'"><br><br>
<TABLE border=1 class='bTable' cellspacing='0' width='550'>
<tr>
    <th><?=translate('code');?>: </th>
</tr>

  <tr>
    <td> &lt;iframe frameborder='0' style='width:<font color='red'>WIDTH</font>;height:<font color='red'>HEIGHT</font>;'<br>
      src='http://www.duoservers.com/?r=<font color='red'>ACCOUNT NAME</font>&action=f_domain'&gt;&lt;/iframe&gt;<br>


    </td>
</tr>
<tr>

    <th> <?=translate('params');?>: </th>
</tr>

<tr>
      <td> <?=translate('final_text');?>
	<br>
    </td>
</tr>
</TABLE>
</div>
